﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyAspx.EasyFramework.DAL3;
using MyAspx.EasyFramework.EntityFramework;
using MyAspx.Framework.WebUnit;

namespace WebUI.Component
{
    public partial class Top : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public string logState
        {
            get
            {
                if (Session["myaspxuser"] != null)
                {
                    return Session["myaspxuser"].ToString() +" <span onclick='logout();' class=\"btn badge badge-danger\">注销</span>";
                }
                else
                {
                    return "<span onclick=\"showLoginDiag()\">登录</span>";
                }
            }
        }

        [WebMethod(false)]
        public static void  LogOut()
        {
            HttpContext.Current.Session["myaspxuser"] = null;
            
        }
    }
}